home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 736 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.8 KB

  1. Path: solon.com!not-for-mail
  2. From: larry.jones@sdrc.com (Larry Jones)
  3. Newsgroups: comp.std.c,comp.lang.c.moderated
  4. Subject: Re: printf() format extensions - looking for beta testers...
  5. Date: 12 Apr 1996 21:27:26 -0500
  6. Organization: SDRC Engineering Services
  7. Sender: clc@solutions.solon.com
  8. Approved: clc@solutions.solon.com
  9. Message-ID: <4kn3ee$3o5@solutions.solon.com>
  10. References: <4kgljv$l2p@solutions.solon.com>
  11. NNTP-Posting-Host: solutions.solon.com
  12.  
  13. In article <4kgljv$l2p@solutions.solon.com>, seebs@solutions.solon.com (Peter Seebach) writes:
  14. >         format('!', bangcvt);
  15. >         /* do something which can generate an error */
  16. >         fprintf(stderr, "%s: %!\n", "open failed");
  17. [...]
  18. > (This example may not be correct, but is expected to give the idea of
  19. > intended usage.)
  20.  
  21. A better example would have %! take one int argument:
  22.  
  23.         fprintf(stderr, "%s: %!\n", "open failed", errno);
  24.  
  25. That avoids problems with errno having been changed before the
  26. formatting function gets a chance to look at it.  In particular, some
  27. previous processing in fprintf may well have changed it.
  28.  
  29. [Good point. -mod]
  30.  
  31. > (Obviously, before any adoption occurs, it will be done with functions
  32. > not named printf/fprintf/etc.)
  33.  
  34. I'm not sure what you mean by this -- are you going to propose a whole
  35. new family of I/O functions rather than an extension to the existing
  36. functions?
  37.  
  38. [I mean I currently have a library of fmt(), ffmt(), sfmt(), snfmt(),
  39.  vfmt(), ..., but that's a legality thing; the proposal would have that
  40.  functionality named printf(), fprintf(), ..., but I can't send out
  41.  reimplementations of library functions and expect it to work. -mod]
  42. ----
  43. Larry Jones, SDRC, 2000 Eastman Dr., Milford, OH  45150-2789  513-576-2070
  44. larry.jones@sdrc.com
  45. I like Mom to be impressed when I fulfill the least of my obligations.
  46. -- Calvin
  47.